package com.lgl.maker.generator;

import cn.hutool.core.io.FileUtil;

import java.nio.charset.StandardCharsets;

/**
 * @author 良哥
 * @verison 1.0
 */
public class ScriptGenerator {

    public static void doGen(String outputPath, String JarPath) {
        StringBuffer sb = new StringBuffer();

        // .bat 文件 命令
        sb.append("@echo off").append("\n");
        sb.append(String.format("java -jar %s %%*", JarPath)).append("\n");

        FileUtil.writeBytes(sb.toString().getBytes(StandardCharsets.UTF_8), outputPath + ".bat");

    }
}
